include config.mk

ifeq "$(TERM)" "cygwin"
	EXT=.bat
endif

all: noraejoe_daddy_rc.py noraejoe-daddy-ko.qm 

noraejoe_daddy_rc.py: noraejoe-daddy.qrc
	pyside-rcc4 -o $@ noraejoe-daddy.qrc 

noraejoe-daddy-ko.qm: noraejoe-daddy-ko.ts
	lrelease noraejoe-daddy-ko.ts -qm $@

lupdate:
	pyside-lupdate *.py -ts noraejoe-daddy-ko.ts


TARGETDIR=$(DESTDIR)$(PREFIX)/share/noraejoe-daddy
install: 
	test ! -d $(TARGETDIR) && mkdir -p $(TARGETDIR) || echo
	cp -a *.py *.qm $(TARGETDIR)
	test ! -d $(DESTDIR)$(PREFIX)/bin && mkdir -p $(DESTDIR)$(PREFIX)/bin || echo
	cp -a noraejoe-daddy $(DESTDIR)$(PREFIX)/bin
	test ! -d $(DESTDIR)$(PREFIX)/share/applications && mkdir -p $(DESTDIR)$(PREFIX)/share/applications || echo
	cp noraejoe-daddy.desktop $(DESTDIR)$(PREFIX)/share/applications
	test ! -d $(DESTDIR)$(PREFIX)/share/pixmaps && mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps || echo
	cp noraejoe-daddy.png $(DESTDIR)$(PREFIX)/share/pixmaps
	$(PYTHON_BIN) /usr/lib/python$(PYTHON_VERSION)/compileall.py $(DESTDIR)$(PREFIX)
	find $(TARGETDIR) -name '*.py' | xargs rm -f

clean: 
	rm -f noraejoe-daddy
	rm -f *_rc.py
	rm -f *.qm
	rm -f *.pyc
	rm -f ui_*.py
	rm -f *.desktop
